<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="x-admin-sm">
	 <head>
	    <jsp:include page="../base_head.jsp"></jsp:include>
    </head>
    
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <form class="layui-form">
                	<div class="layui-form-item">
                        <label for="L_username" class="layui-form-label">
                            <span class="x-red">*</span>微信id</label>
                        <div class="layui-input-inline">
                            <input type="text" readonly="readonly" id="wx_openid" name="wx_openid" required="" lay-verify="nikename" autocomplete="off" class="layui-input" value="${requestScope.edit.wx_openid }"></div>
                    </div>
                    <div class="layui-form-item">
                        <label for="L_username" class="layui-form-label">
                            <span class="x-red">*</span>用户id</label>
                        <div class="layui-input-inline">
                            <input type="text" readonly="readonly" id="user_id" name="user_id" required="" lay-verify="nikename" autocomplete="off" class="layui-input" value="${requestScope.edit.user_id }"></div>
                    </div>
                    <div class="layui-form-item">
                        <label for="L_email" class="layui-form-label">
                            <span class="x-red">*</span>用户名</label>
                        <div class="layui-input-inline">
                            <input type="text" id="L_user" name="username" required="" autocomplete="off" class="layui-input" value="${requestScope.edit.user_name }"></div>
                        </div>
                    <div class="layui-form-item">
                     	<label for="L_username" class="layui-form-label">
                     	    <span class="x-red">*</span>用户头像</label>
                    	 <div class="layui-input-inline">
                       	  <input type="text" id="user_img" name="user_img" required="" lay-verify="nikename" autocomplete="off" class="layui-input" value="${requestScope.edit.user_img }"></div>
                    </div>
                    <div class="layui-form-item">
                        <label for="L_repass" class="layui-form-label"></label>
                        <button class="layui-btn" lay-filter="add" lay-submit="">修改</button></div>
                </form>
            </div>
        </div>
        <script>layui.use(['form', 'layer'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;

               

                //监听提交
                form.on('submit(add)',
                function(data) {
                    //console.log(data);
                    var dataset = data.field;
                    
                    $.post("update.do",dataset,function(res){
                    	console.log(res);
                    	if(res=="1"){
                    		layer.alert("修改成功", {
                                icon: 6
                            },
                            function() { 
                                parent.location.reload()
                            });
                    	}else{
                    		alert("修改失败");
                    	}
                    });
                    
                    //发异步，把数据提交给php
                    /*
                    
                    */
                    return false;
                });

            });</script>
        
    </body>

</html>